﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="LuminousIntensity.cs" company="QuantityTypes">
//   Copyright (c) 2014 QuantityTypes contributors
// </copyright>
// <summary>
//   Implements operators related to luminous intensity.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace QuantityTypes
{
    /// <summary>
    ///     Implements operators related to luminous intensity.
    /// </summary>
    public partial struct LuminousIntensity
    {
        /// <summary>
        ///     Implements the operator /.
        ///     E=I/r²
        /// </summary>
        /// <param name="l1"> The illuminance. </param>
        /// <param name="l2"> The length. </param>
        /// <returns> Illuminance generated by a luminous intensity in the given distance. </returns>
        public static Illuminance operator /(LuminousIntensity l1, Length l2)
        {
            return new Illuminance(l1.value / l2.Squared().Value);
        }
    }
}